﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;
using Entities;
using BUS;
public partial class Administrator_Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            load_data();
        }
    }

    protected void load_data()
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        Literal1.Text = "<font color='Blue'>Thay đổi tình trạng sản phẩm</font>";
        Tbl_SanPham_Entities sp = Tbl_SanPham_BUS.GetByID(id);
        lit_stt.Text = sp.STT.ToString();
        lit_masp.Text = sp.MaSP.ToString();
        hyp_tensp.Text = sp.TenSP;
        ddl_tt.Text = sp.TinhTrang;
    }
    protected void bt_ok_Click(object sender, EventArgs e)
    {
        Tbl_SanPham_Entities sp = new Tbl_SanPham_Entities();
        sp.STT = int.Parse(lit_stt.Text);
        sp.TinhTrang = ddl_tt.Text;
        Tbl_SanPham_BUS.Update_tinhtrang(sp);
    }
}
